package com.xique.park.bean.vo.web.parkingOrder;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xique.park.bean.transform.web.car.MoneyTypeConvert;
import com.xique.park.bean.transform.web.car.MynTypeConverter;
import com.xique.park.bean.transform.web.records.PayStatusConverter;
import com.xique.park.bean.vo.web.parkIn.ParkInVo;
import com.xique.park.bean.vo.web.parkInAndOut.detail.ParkCouponDetailVo;
import com.xique.park.bean.vo.web.parkInAndOut.detail.ParkOrderDetailVo;
import com.xique.park.bean.vo.web.parkOut.ParkOutVo;
import com.xique.park.bean.vo.web.payOrder.PayOrderVo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单VO
 *
 * @author wld
 * @date 2022/3/11 16:40
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ExcelIgnoreUnannotated
public class ParkingOrderVo implements Serializable {

    private Long id;

    private Long parkId;

    /**
     * 订单编号（不用id）：多个用，分开
     */
    private String orderIds;

    /**
     * 支付记录序列号
     */
    @ExcelProperty(value = "支付序列号", index = 0)
    @ColumnWidth(30)
    private String paySsn;

    /**
     * 车牌号
     */
    @ExcelProperty(value = "车牌号", index = 1)
    private String plate;

    /**
     * 车辆管理类型大类：1、月卡类，2、登记临停类，3、邀请访客类，4、会员临停类，5、普通临停类，6、新能源临停类，7、共享车，8、伪车牌
     */
    @ExcelProperty(value = "管理类型", converter = MynTypeConverter.class, index = 2)
    private String mngType;

    /**
     * 车辆管理类型名称
     */
    private String mngTypeName;

    /**
     * 进场时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "入场时间", index = 3)
    @ColumnWidth(20)
    private Date inTime;

    /**
     * 车辆在场、出场状态(on-在场，out-出场)
     */
    @ExcelProperty(value = "在场状态", converter = MynTypeConverter.class, index = 4)
    private String parkStatus;

    /**
     * 总金额
     */
    @ExcelProperty(value = "总金额", converter = MoneyTypeConvert.class, index = 5)
    @NumberFormat("#0.00")
    private BigDecimal totalFee;

    /**
     * 提前支付金额
     */
    @ExcelProperty(value = "提前支付金额", converter = MoneyTypeConvert.class, index = 6)
    @NumberFormat("#0.00")
    private BigDecimal paidFee;

    /**
     * 优惠券抵扣金额
     */
    @ExcelProperty(value = "优惠金额", converter = MoneyTypeConvert.class, index = 7)
    @NumberFormat("#0.00")
    private BigDecimal couponFee;

    /**
     * 本次出场需支付金额
     */
    @ExcelProperty(value = "实付金额", converter = MoneyTypeConvert.class, index = 8)
    @NumberFormat("#0.00")
    private BigDecimal payFee;

    /**
     * 车辆支付状态（1-未支付 2-已支付 3-待确认 4-已取消 6-现金已支付 7-免费放行）
     */
    @ExcelProperty(value = "支付状态", converter = PayStatusConverter.class, index = 9)
    private String payStatus;

    /**
     * 停车流水号，唯一标识某一次停车
     */
    private String parkingSerial;

    /**
     * 订单总数
     */
    private Long totalCount;

    /**
     * 订单总金额
     */
    private BigDecimal totalPrice;

    /**
     * 停车时长（秒）
     */
    private Long parkingTime;

    private String parkName;

    /**
     * 实际支付总费用
     */
    private BigDecimal totalActualFee;

    /**
     * 入场详细信息
     */
    private ParkInVo parkIn;

    /**
     * 出场详细信息
     */
    private ParkOutVo parkOut;

    /**
     * 支付记录
     */
    private List<PayOrderVo> payOrderList;

    /**
     * 停车券记录
     */
    private List<ParkCouponDetailVo> parkCouponPpList;

    private ParkOrderDetailVo parkOrderDetailVo;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "创建时间", index = 10)
    @ColumnWidth(30)
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "更新时间", index = 11)
    @ColumnWidth(30)
    private Date updateTime;


}
